<?php
class VariablesGroup extends AppModel
{
  var $name = 'VariablesGroup';
  var $useTable = "variable_types";
  var $id = "vt_id";
  var $primaryKey = "vt_id";

  function get_variables_group()
  {
		$rows = $this->findAll(null, "vt_id, vt_name", "vt_name", null, 1, null);
		return $rows;
	}

	function getFieldValue($field, $key, $key_value)
	{
		$rows = $this->field($field, array("$key" => "$key_value"));
		return $rows;
  }

  function getFieldsValue($whereArray, $fields)
  {
		$rows = $this->find($whereArray, $fields, null, null);
		return $rows;
  }

  function setPrimaryKey ($key)
  {
    $this->primaryKey = $key;
  }

  function getListVariablesGroup()
  {
    return $this->generateList(null, "vt_name", null, "{n}.VariablesGroup.vt_id", "{n}.VariablesGroup.vt_name");
  }
}
?>
